import mongoose from 'mongoose'
import { ACTION, registerResouceModel } from '.'

const dictSchema = new mongoose.Schema({
  name: {
    type: String,
    required: true,
  },
  value: {
    type: String,
    required: true,
  },
  parentId: {
    type: String,
    default: '',
  },
})

const Dict = mongoose.model('Dict', dictSchema)

registerResouceModel({
  name: Dict.name,
  model: Dict,
  action: ACTION.READWRITE,
  desc: '字典'
})

export default Dict